#ifndef __REFLEKTOR_HPP__
#define __REFLEKTOR_HPP__

#include "ReflectorIF.hpp"

class Reflector : public ReflectorIF {
	private:
		std::string mapping;

	public:
		Reflector() {
			mapping.resize(26);
		}

		/**
		 * add new substitution pair.
		 * e.g. calling add('A', 'B') will make the reflect method substitute A with B and vice versa.
		 */
		void add(char character1, char character2) {
			mapping[character1 - 'A'] = character2;
			mapping[character2 - 'A'] = character1;
		}

		/**
		 * apply stored substitutions.
		 */
		char reflect(char character) const {
			return mapping[character - 'A'];
		}
};
#endif

